﻿using System;
using System.Collections.Generic;
using System.Linq;
using Newtonsoft.Json;

namespace LoL_Profiler
{
    public class ElophantAPI
    {
        public class Summoner
        {
            public static RootObject getProfileSummonerInfo(string json)
            {
                return JsonConvert.DeserializeObject<RootObject>(json);
            }

            public class Data
            {
                public string internalName { get; set; }
                public string name { get; set; }
                public int acctId { get; set; }
                public int profileIconId { get; set; }
                public DateTime revisionDate { get; set; }
                public int summonerLevel { get; set; }
                public int summonerId { get; set; }
            }

            public class RootObject
            {
                public Data data { get; set; }
                public bool success { get; set; }
                public string error { get; set; }
            }
        }

        public class PlayerStats
        {
            public static RootObject getPlayerStats(string json)
            {
                return JsonConvert.DeserializeObject<RootObject>(json);
            }

            public class AggregatedStats
            {
                public List<object> stats { get; set; }
            }

            public class PlayerStatSummarySet
            {
                public int maxRating { get; set; }
                public int leaves { get; set; }
                public DateTime modifyDate { get; set; }
                public int losses { get; set; }
                public int rating { get; set; }
                public int wins { get; set; }
                public string playerStatSummaryType { get; set; }
                public AggregatedStats aggregatedStats { get; set; }
            }

            public class PlayerStatSummaries
            {
                public List<PlayerStatSummarySet> playerStatSummarySet { get; set; }
            }

            public class Data
            {
                public PlayerStatSummaries playerStatSummaries { get; set; }
                public DateTime previousFirstWinOfDay { get; set; }
                public int userId { get; set; }
            }

            public class RootObject
            {
                public Data data { get; set; }
                public bool success { get; set; }
            }
        }

        public class RecentGames
        {
            public static RootObject getRecentGames(string json)
            {
                return JsonConvert.DeserializeObject<RootObject>(json);
            }

            public class FellowPlayer
            {
                public int championId { get; set; }
                public int summonerId { get; set; }
                public string summonerName { get; set; }
                public int teamId { get; set; }
            }

            public class Statistic
            {
                public string statType { get; set; }
                public int value { get; set; }
            }

            public class GameStatistic
            {
                public bool ranked { get; set; }
                public int skinIndex { get; set; }
                public List<FellowPlayer> fellowPlayers { get; set; }
                public string gameType { get; set; }
                public int experienceEarned { get; set; }
                public bool eligibleFirstWinOfDay { get; set; }
                public int gameMapId { get; set; }
                public bool leaver { get; set; }
                public int spell1 { get; set; }
                public int spell2 { get; set; }
                public int teamId { get; set; }
                public int summonerId { get; set; }
                public List<Statistic> statistics { get; set; }
                public bool afk { get; set; }
                public int boostXpEarned { get; set; }
                public int level { get; set; }
                public int userId { get; set; }
                public DateTime createDate { get; set; }
                public int userServerPing { get; set; }
                public int premadeSize { get; set; }
                public int boostIpEarned { get; set; }
                public int gameId { get; set; }
                public int timeInQueue { get; set; }
                public int ipEarned { get; set; }
                public string gameMode { get; set; }
                public string subType { get; set; }
                public string queueType { get; set; }
                public bool premadeTeam { get; set; }
                public int championId { get; set; }
            }

            public class Data
            {
                public List<GameStatistic> gameStatistics { get; set; }
                public int userId { get; set; }
            }

            public class RootObject
            {
                public Data data { get; set; }
                public bool success { get; set; }
                public string error { get; set; }
            }
        }
    }

    

}
